package com.nine.utils;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
	private DateUtil() {

	}

	public static String getSystemDate() {
		return getForPattern("yyyy-MM-dd");

	}

	public static String getSystemTime() {
		return getForPattern("HH:mm:ss");
	}

	public static String getSystemDateAndTime() {
		return getForPattern("yyyy-MM-dd HH:mm:ss");
	}

	public static String getTimeStmap() {
		return getForPattern("yyyyMMddHHmmssS");
	}

	public static String getForPattern(String pattern) {
		Date date = new Date();
		DateFormat dateFormat = new SimpleDateFormat(pattern);
		String strTime = dateFormat.format(date);
		return strTime;
	}
}
